import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsInt, Min } from 'class-validator';
import { DictItem } from '../../entities/dict-item.entity';
import { Dict } from '../../entities/dict.entity';

export class PageDictDto extends Dict {
  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageSize: number = 10;

  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageNo: number = 1;
}
export class DictItemDto extends DictItem {
  @ApiProperty({
    description: '字典dictId',
    required: false,
    default: '',
  })
  dictId: any = '';
}

export class PageDictItemtDto extends DictItem {
  @ApiProperty({
    description: '字典dictId',
    required: false,
    default: '',
  })
  dictId: any = '';
  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 10,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageSize: number = 10;

  @ApiProperty({
    description: '当前页包含数量',
    required: false,
    default: 1,
  })
  @Type(() => Number)
  @IsInt()
  @Min(1)
  readonly pageNo: number = 1;
}
